.class public Lcn/cheln/explorer/cpnt/adapter/CountAdapter;
.super Lcn/cheln/explorer/cpnt/adapter/FileAdapter;


# instance fields
.field public a:Ljava/util/Map;

.field private f:I

.field private g:Landroid/database/Cursor;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcn/cheln/support/adapter/d;)V
    .locals 2

    invoke-direct {p0, p1, p2}, Lcn/cheln/explorer/cpnt/adapter/FileAdapter;-><init>(Landroid/content/Context;Lcn/cheln/support/adapter/d;)V

    new-instance v0, Ljava/util/TreeMap;

    new-instance v1, Lcn/cheln/explorer/cpnt/adapter/a;

    invoke-direct {v1}, Lcn/cheln/explorer/cpnt/adapter/a;-><init>()V

    invoke-direct {v0, v1}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V

    iput-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->a:Ljava/util/Map;

    return-void
.end method


# virtual methods
.method public a(I)Lcn/cheln/explorer/beans/FileInfo;
    .locals 5

    const/4 v1, 0x0

    :try_start_0
    invoke-virtual {p0}, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->e()Lcn/cheln/support/adapter/a;

    move-result-object v0

    invoke-virtual {v0}, Lcn/cheln/support/adapter/a;->b()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/database/Cursor;

    iput-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->g:Landroid/database/Cursor;

    iget-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->g:Landroid/database/Cursor;

    invoke-interface {v0, p1}, Landroid/database/Cursor;->moveToPosition(I)Z

    new-instance v0, Lcn/cheln/explorer/beans/FileInfo;

    iget-object v2, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->g:Landroid/database/Cursor;

    iget-object v3, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->g:Landroid/database/Cursor;

    const-string v4, "_data"

    invoke-interface {v3, v4}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v3

    invoke-interface {v2, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v2}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    move-object v0, v1

    goto :goto_0
.end method

.method protected final a(Lcn/cheln/explorer/beans/FileInfo;)Lcn/cheln/support/images/ThumbnailBase;
    .locals 3

    invoke-super {p0, p1}, Lcn/cheln/explorer/cpnt/adapter/FileAdapter;->a(Lcn/cheln/explorer/beans/FileInfo;)Lcn/cheln/support/images/ThumbnailBase;

    move-result-object v2

    instance-of v1, p1, Lcn/cheln/explorer/beans/MusicInfo;

    if-eqz v1, :cond_0

    move-object v0, p1

    check-cast v0, Lcn/cheln/explorer/beans/MusicInfo;

    move-object v1, v0

    iget-object v1, v1, Lcn/cheln/explorer/beans/MusicInfo;->thumbnail:Ljava/lang/String;

    if-eqz v1, :cond_0

    check-cast p1, Lcn/cheln/explorer/beans/MusicInfo;

    iget-object v1, p1, Lcn/cheln/explorer/beans/MusicInfo;->thumbnail:Ljava/lang/String;

    iput-object v1, v2, Lcn/cheln/support/images/ThumbnailBase;->thumbnailPath:Ljava/lang/String;

    :cond_0
    return-object v2
.end method

.method public final a(Lcn/cheln/support/adapter/a;)V
    .locals 1

    iget-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->a:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    invoke-super {p0, p1}, Lcn/cheln/explorer/cpnt/adapter/FileAdapter;->a(Lcn/cheln/support/adapter/a;)V

    return-void
.end method

.method protected a(Ljava/lang/Object;ILandroid/view/View;)V
    .locals 3

    invoke-super {p0, p1, p2, p3}, Lcn/cheln/explorer/cpnt/adapter/FileAdapter;->a(Ljava/lang/Object;ILandroid/view/View;)V

    const v0, 0x7f080055

    invoke-virtual {p3, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    if-eqz v0, :cond_0

    instance-of v1, p1, Lcn/cheln/explorer/beans/ApkInfo;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->b:Landroid/content/Context;

    const/high16 v2, 0x42d2

    invoke-static {v1, v2}, Lcn/cheln/support/app/a;->a(Landroid/content/Context;F)I

    move-result v1

    :goto_0
    iput v1, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->f:I

    check-cast v0, Landroid/widget/TextView;

    iget v1, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->f:I

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setMaxWidth(I)V

    :cond_0
    return-void

    :cond_1
    iget-object v1, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->b:Landroid/content/Context;

    const/high16 v2, 0x4382

    invoke-static {v1, v2}, Lcn/cheln/support/app/a;->a(Landroid/content/Context;F)I

    move-result v1

    goto :goto_0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 3

    iget-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->a:Ljava/util/Map;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->a:Ljava/util/Map;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-super {p0, p1}, Lcn/cheln/explorer/cpnt/adapter/FileAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    iget-object v0, p0, Lcn/cheln/explorer/cpnt/adapter/CountAdapter;->a:Ljava/util/Map;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    if-nez v0, :cond_1

    const/4 v0, 0x0

    :cond_1
    return-object v0
.end method
